const express = require('express');
const favicon = require('serve-favicon');
// const mySql = require('./router/database')

// 引入登录注册
const loginrouter = require('./router/loginRouter')
const board = require('./router/board')
const gobackcode = require('./router/gobackcode')
const mySql = require('./utils/database')
// const mySql = require('./router/database');
// 引入登录注册
// const loginrouter = require('./router/loginRouter')
const instockRouter = require('./router/instockRouter');

// zx
const zxApp = require('./public/js/zx_xiaoshou.js')
const zxTj = require('./public/js/zx_tongji.js')

//创建服务

const plantRouter = require('./router/plantRouter')
const dj01Router = require('./router/dj01Router')
// const onlineShopRouter = require('./router/online_shop_router')
const tranVeRouter = require('./router/tran_ve')
// const pick_route = require('./router/pick_route');

const supplierRouter = require('./router/supplierRouter')
const wasteRouter = require('./router/wasteRouter')
const productionRouter = require('./router/productionRouter')

const app = express();

app.use(express.static('./public'));
app.use(express.static('./public/pages'))
app.use(favicon('./public/favicon.ico'))
// 配置post
app.use(express.json())
app.use(express.urlencoded({ extended: true }));

// 引入我的路由
const pick_route = require('./router/pick_route');
app.use(pick_route);


// 使用登录注册
app.use(loginrouter)
app.use(board)
app.use(gobackcode)
app.use(zxApp)
app.use(zxTj)

// app.listen(5250, function () {

// app.use(express.json()) //请求数据以json格式为主
// app.use(express.urlencoded({ extended: true }));//请求头的数据类型为 x/www-form-urlencoded
// app.use(dj01Router);
// 引入我的路由
// app.use(pick_route);//刘锦昌
// app.use(express.json()) //请求数据以json格式为主
// app.use(express.urlencoded({ extended: true }));//请求头的数据类型为 x/www-form-urlencoded

app.use(instockRouter);

// 使用登录注册
// app.use(loginrouter)

// app.use(express.json())
// app.use(express.urlencoded({ extended: true }));
app.use(plantRouter);
app.use(dj01Router);
// app.use(onlineShopRouter);
app.use(tranVeRouter)

app.use(supplierRouter);
app.use(wasteRouter);
app.use(productionRouter);

app.listen(8781, function () {
    console.log('运行成功');
})